--Sbox-4-set
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;

entity Sbox4set is
    Port ( si : in  STD_LOGIC_VECTOR (127 downto 0);
		so : out  STD_LOGIC_VECTOR (127 downto 0));
end Sbox4set;

architecture Behavioral of Sbox4set is
component Sbox4 is
    Port ( i : in  STD_LOGIC_VECTOR (4 DOWNTO 0);
           o : out  STD_LOGIC_VECTOR (4 DOWNTO 0));
end component Sbox4; 
	   
signal n1, n2, n3, n4, n5, n6, n7, n8, n9, n10, n11, n12, n13, n14, n15, n16, n17, n18, n19, n20, n21, n22, n23, n24, n25, n26, n27, n28, n29, n30, n31, n32 : STD_LOGIC_VECTOR (4 downto 0);
begin
b1: Sbox4 port map (si(3 downto 0), n32);	 
b2: Sbox4 port map (si(7 downto 4), n31);
b3: Sbox4 port map (si(11 downto 8), n30);
b4: Sbox4 port map (si(15 downto 12), n29);
b5: Sbox4 port map (si(19 downto 16), n28);
b6: Sbox4 port map (si(23 downto 20), n27);
b7: Sbox4 port map (si(27 downto 24), n26);
b8: Sbox4 port map (si(31 downto 28), n25);
b9: Sbox4 port map (si(35 downto 32), n24);
b10: Sbox4 port map (si(39 downto 36), n23);
b11: Sbox4 port map (si(43 downto 40), n22);
b12: Sbox4 port map (si(47 downto 44), n21);
b13: Sbox4 port map (si(51 downto 48), n20);
b14: Sbox4 port map (si(55 downto 52), n19);
b15: Sbox4 port map (si(59 downto 56), n18);
b16: Sbox4 port map (si(63 downto 60), n17);
b17: Sbox4 port map (si(67 downto 64), n16);
b18: Sbox4 port map (si(71 downto 68), n15);
b19: Sbox4 port map (si(75 downto 72), n14);
b20: Sbox4 port map (si(79 downto 76), n13);
b21: Sbox4 port map (si(83 downto 80), n12);
b22: Sbox4 port map (si(87 downto 84), n11);
b23: Sbox4 port map (si(91 downto 88), n10);
b24: Sbox4 port map (si(95 downto 92), n9);
b25: Sbox4 port map (si(99 downto 96), n8);
b26: Sbox4 port map (si(103 downto 100), n7);
b27: Sbox4 port map (si(107 downto 104), n6);
b28: Sbox4 port map (si(111 downto 108), n5);
b29: Sbox4 port map (si(115 downto 112), n4);
b30: Sbox4 port map (si(119 downto 116), n3);
b31: Sbox4 port map (si(123 downto 120), n2);
b32: Sbox4 port map (si(127 downto 124), n1);
so <= n1&n2&n3&n4&n5&n6&n7&n8&n9&n10&n11&n12&n13&n14&n15&n16&n17&n18&n19&n20&n21&n22&n23&n24&n25&n26&n27&n28&n29&n30&n31&n32;
end Behavioral;